<?xml version='1.0' encoding='UTF-8' ?>
<f:view xmlns="http://www.w3.org/1999/xhtml" 
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"
        xmlns:pm="http://primefaces.org/mobile"
        contentType="text/html">
    
    <pm:page title="BICE" >
        <f:facet name="postinit">
            <script type="text/javascript">
                jQuery(document).ready(function(){
                    //Home Page icon
                    //jQuery('head').append('<link rel="apple-touch-icon" href="images/logo.jpg"/>');
                    //Splash screen for iPhone
                    //jQuery('head').append('<link rel="apple-touch-startup-image" href="resources/mail.png"/>');
                    //This will hide the browser address bar
                    jQuery('head').append('<meta name="apple-mobile-web-app-capable" content="yes" />');
                    jQuery('head').append('<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width"/>');
                    //Adds a custom style sheet
                    jQuery('head').append('<link href="resources/style.css" rel="stylesheet" type="text/css"/>');
                    //jQuery('head').append('<link rel="icon" href="resources/images/mytv.ico" />');
                });
            </script>
        </f:facet>
        
        <pm:view id="mainView">
            <pm:header title="#{sessionBean.user.nickname}">
                <f:facet name="left">
                    <p:button value="Regresar" icon="back" href="#{configBean.rootPath}/faces/index.xhtml"/>
                </f:facet>
            </pm:header>
            <pm:content>
                <h:form id="formMain">
                    
                    <p:focus context="formMain"/>
                    
                    <h:dataTable value="#{communityBean.postsToLoggedUser}" var="i" style="width: 100%">
                        <h:column>
                            <f:facet name="header">
                                <h:inputText value="#{communityBean.message}" />
                                <h:panelGroup style="display: none">
                                    <p:commandButton value="" update="@form" actionListener="#{communityBean.post}"/>
                                </h:panelGroup>
                            </f:facet>
                            <h:commandLink value="#{i.message}" action="message" styleClass="messageLink">
                                <f:setPropertyActionListener target="#{sessionBean.post}" value="#{i}"/>
                            </h:commandLink>
                            <br/><br/>
                            <h:outputText value="#{i.sign}"/>
                            <p:separator/>
                        </h:column>
                    </h:dataTable>
                </h:form>
            </pm:content>
        </pm:view>

    </pm:page>
</f:view>